package city.spring.modules.personnel.service;

import city.spring.modules.personnel.entity.EmployeeRewardPunishmentEntity;
import city.spring.modules.personnel.vo.EmployeeRewardPunishmentEntityVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import lombok.NonNull;
import org.apache.ibatis.annotations.Param;

import java.security.Principal;
import java.util.List;

/**
 * Service：员工奖惩
 *
 * @author 潘小梅
 * @date 2020-04-08 15:12:03
 */
public interface EmployeeRewardPunishmentService extends IService<EmployeeRewardPunishmentEntity> {
    String CACHE_NAME = "employee_reward_punishment";

    /**
     * 业务处理：保存一个 <strong>员工奖惩</strong>
     *
     * @param entity 员工奖惩
     */
    void saveEmployeeRewardPunishment(EmployeeRewardPunishmentEntity entity, @NonNull Principal user);

    /**
     * 业务处理：修改一个 <strong>员工奖惩</strong>
     *
     * @param entity 员工奖惩
     */
    void updateEmployeeRewardPunishment(EmployeeRewardPunishmentEntity entity);

    /**
     * 业务处理：删除一个 <strong>员工奖惩</strong>
     *
     * @param primaryKey 主键ID
     */
    void deleteEmployeeRewardPunishment(String primaryKey);

    /**
     * 业务处理：删除多个 <strong>员工奖惩</strong>
     *
     * @param primaryKeys 主键ID列表
     */
    void deleteEmployeeRewardPunishment(List<String> primaryKeys);

    /**
     * 分页获取的奖惩记录
     *
     * @param page    分页对象
     * @param wrapper 查询对象
     * @return 奖惩记录
     */
    IPage<EmployeeRewardPunishmentEntityVO> listPage(Page<? extends EmployeeRewardPunishmentEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends EmployeeRewardPunishmentEntity> wrapper);
}